
#*--encoding:UTF-8--*

'''
整理数据
'''
from common.config import *
from db.mysql import MysqlClient
from common.helper import Helper

class Arrangement( object ):

    def __init__(self):
        self.name = "和谐健康宝宝少儿定期重大疾病保险计划"
        self.mysql = MysqlClient()

    def pullData(self, data={}):
        for item in Helper.selectData(self.name, self.mysql):

            data["name"] = self.name
            data["company"] = "和谐健康保险"
            data["year"] = item["year"]
            data["gender"] = "1" if item["gender"]=="0" else "0"
            data["expire"] = item["expire"] + "年"
            data["interval"] = item["paytime"]
            data["seriousMedical"] = item["ext_item"] + "w"
            data["price"] = item["price"]
            data["money"] = item["money"] + "w"
            data["majorDisease"] = item["ext_item"] + "w"
            Helper.mergeTable( self.name,self.mysql,data )
